//
//  ViewController.m
//  Xmpp
//
//  Created by lanou3g on 16/1/28.
//  Copyright © 2016年 徐强. All rights reserved.
//

#import "ViewController.h"
#import "Manager.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *uesrName;
@property (weak, nonatomic) IBOutlet UITextField *password;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    Manager *mgr = [Manager shareManage];
//    //注册
//    [mgr registWithUser:@"XQ" passWord:@"xq" success:^(id data) {
//        //成功
//        NSLog(@"注册成功");
//    } fail:^(NSError *err) {
//        //失败
//        NSLog(@"注册失败");
//    }];



    
}
//登陆
- (IBAction)login:(UIButton *)sender {
        Manager *mgr = [Manager shareManage];
        //登陆
        [mgr loginWithUser:self.uesrName.text passWord:self.password.text success:^(id data) {
            //获取storyboard
            UIStoryboard *story = [UIStoryboard storyboardWithName:@"RostStoryBoard" bundle:nil];
            //设置跟视图为
            [UIApplication sharedApplication].keyWindow.rootViewController = [story instantiateViewControllerWithIdentifier:@"RostViewController"];
        } fail:^(NSError *err) {
            
        }];
}



@end
